﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Util;
namespace Xproject.Util
{
  public  class Cache_Category
    {
        public static string CACHE_KEY_CATEGORY_ALL = "CACHE_KEY_PRODUCT_ALL";
        

        public static List<Category> CategoryList
        {
            get
            {
                return System.Web.HttpRuntime.Cache[CACHE_KEY_CATEGORY_ALL] as List<Category>;

            }
            set
            {
                System.Web.HttpRuntime.Cache.Insert(CACHE_KEY_CATEGORY_ALL, value, null, DateTime.Now.AddDays(1), System.Web.Caching.Cache.NoSlidingExpiration);
            }
        }

        /// <summary>
        /// 清理推荐的产品缓存
        /// </summary>
        public static void ClearCategory()
        {
            System.Web.HttpRuntime.Cache.Remove(CACHE_KEY_CATEGORY_ALL);
        }
    }
}
